package io.bdmc.modules.bss.service.impl;

import io.bdmc.common.annotation.DataFilter;
import io.bdmc.common.utils.MyPage;
import io.bdmc.modules.bss.entity.SmkDevice;
import io.bdmc.modules.bss.mapper.SmkDeviceMapper;
import io.bdmc.modules.bss.model.DevParam;
import io.bdmc.modules.bss.service.ISmkDeviceService;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author huang lu
 * @since 2019-01-21
 */
@Service
public class SmkDeviceServiceImpl extends ServiceImpl<SmkDeviceMapper, SmkDevice> implements ISmkDeviceService {
    @Autowired
    private SmkDeviceMapper devMapper;

    @DataFilter(tableAlias = "d", user = false)
    @Override
    public MyPage<SmkDevice> mySelectPage(MyPage<SmkDevice> page, DevParam shopParam) {
        return devMapper.mySelectPage(page, shopParam);
    }

    @Override
    public Integer updateBatch(Long shop_id, Long dept_id, Long[] devids) {
        return devMapper.updateBatch(shop_id, dept_id, devids);
    }

    @Override
    public Map<String, Object> wxDeviceSum(Long deptId) {
        return devMapper.wxDeviceSum(deptId);
    }

    @DataFilter(tableAlias = "d", user = false)
    @Override
    public Long countByDepId(MyPage<SmkDevice> page) {
        return devMapper.countByDepId(page);
    }

    @Override
    public Integer unBindDev(Long[] devids) {
        return devMapper.unBindDev(devids);
    }

    @Override
    public Long selectCountByDepId(Long deptId) {
        return devMapper.selectCountByDepId(deptId);
    }

    @Override
    public List<SmkDevice> listHKOfflineDevice() {
        return devMapper.listHKOfflineDevice();
    }
}
